import java.util.*;




interface Library{
    public abstract void borrow();
    public abstract void revert();
}
class Book{
    String name;
    String publisher;
    Book(String name,String publisher){
        name=name;
        publisher=publisher;
    }
    public void getter(){
        System.out.println(name);
    }
    public String setter(String str1){
        name=str1;
        System.out.println(name);
        return null;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Book)) return false;
        Book book = (Book) o;
        return Objects.equals(name, book.name) &&
                Objects.equals(publisher, book.publisher);
    }

    @Override
    public String toString() {
        return "”书名："+name+"，出版社"+publisher+"“";
    }
}
    class CollectionBook extends Book implements Library{
        String bNo;
        String stacks;
        boolean isBorrow;
        CollectionBook(String name,String publisher,String bNo,String stacks){
            super(name,publisher);
            bNo=bNo;
            stacks=stacks;
        }
        public  void borrow(){
            if (isBorrow){
                System.out.println("对不起，该图书已借阅");
            }else {
                isBorrow=false;
                System.out.println("借阅成功");
            }
        }
        public  void revert(){
            if (isBorrow){
                isBorrow=false;
                System.out.println("还书成功");
            }else{
                System.out.println("该图书已归还");
            }

        }
    }

   public class test3{
    public static void main(String[]args){
        CollectionBook book1=new CollectionBook("java程序设计","清华大学出版社","11111","线路图书库1");
        CollectionBook book2=new CollectionBook("java程序设计","清华大学出版社","11111","线路图书库1");
            System.out.println("比较结果："+book1.equals(book2) );
            System.out.println("请输入:");
         Scanner sc =new Scanner(System.in );
         int a=sc.nextInt();
         if(a==1){
            book1.borrow();
         }if(a==0){
             book1.revert();
        }else {
        }

    }

   }


